#ifndef _SYS_DATE_H_
#define _SYS_DATE_H_

#include "FanObj.h"
#include "SysTypes.h"

#define DATE_VTABLE(self)   ((DateVTable*)((FanObj*)self)->vtable)


extern Type*    Date_classType;
extern VTable*  Date_classVTable;


/* [sys::Date] Attributes */
struct Date
{
  FanObj        super;
};


/* [sys::Date] Virtual-table */
typedef struct DateVTable
{
  FanObjVTable  super;
} DateVTable;


/* [sys::Date] Methods and fields */
Bool            Date_equals(Obj self, NullableObj that);
Int             Date_compare(Obj self, Obj obj);
Int             Date_hash(Obj self);
Str*            Date_toStr(Obj self);
Date*           Date_defVal(void);
Date*           Date_today_0(void);
Date*           Date_today(TimeZone* tz);
Date*           Date_make(Int year, Month* month, Int day);
Date*           Date_fromStr_1(Str* s);
Date*           Date_fromStr(Str* s, Bool checked);
Int             Date_year(Date* self);
Month*          Date_month(Date* self);
Int             Date_day(Date* self);
Weekday*        Date_weekday(Date* self);
Int             Date_dayOfYear(Date* self);
Str*            Date_toLocale_0(Date* self);
Str*            Date_toLocale(Date* self, Str* pattern);
Date*           Date_fromLocale_2(Str* str, Str* pattern);
Date*           Date_fromLocale(Str* str, Str* pattern, Bool checked);
Date*           Date_fromIso_1(Str* s);
Date*           Date_fromIso(Str* s, Bool checked);
Str*            Date_toIso(Date* self);
Date*           Date_plus(Date* self, Duration* days);
Date*           Date_minus(Date* self, Duration* days);
Duration*       Date_minusDate(Date* self, Date* days);
Date*           Date_firstOfMonth(Date* self);
Date*           Date_lastOfMonth(Date* self);
Bool            Date_isYesterday(Date* self);
Bool            Date_isToday(Date* self);
Bool            Date_isTomorrow(Date* self);
DateTime*       Date_toDateTime_1(Date* self, Time* t);
DateTime*       Date_toDateTime(Date* self, Time* t, TimeZone* tz);
DateTime*       Date_midnight_0(Date* self);
DateTime*       Date_midnight(Date* self, TimeZone* tz);
Str*            Date_toCode(Date* self);


/* [sys::Date] Type-system functions */
Type*           Date_initType(void);
VTable*         Date_initVTable(void);
void            Date_initStatic(void);


#endif
